//go:build linux

package gogo

import (
	"gogo/gohttp"
	"net/http"
	"strconv"
)

// StartHTTP 启动GoHTTP服务
func StartV3HTTP(port int) error {
	return StartV3HTTP2(&http.Server{
		Addr: ":" + strconv.Itoa(port),
	})
}

// StartHTTP 启动GoHTTP服务
func StartV3HTTP2(server *http.Server) error {
	Log().Info("GoHTTP Service Running on ", server.Addr)
	gohttp := gohttp.NewGoHttp()
	server.Handler = mpHttpRouterHandler
	if err := gohttp.Start(server); err != nil {
		return err
	}
	return nil
}
